public class Thread2 {
    public static void main(String[] args) {
       MyThread2 myThread2=new MyThread2();
       Thread thread=new Thread(myThread2);
       thread.start();
    }
    static class MyThread2 implements Runnable{
        @Override
        public void run() {
            Thread thread=Thread.currentThread();
            System.out.println("当前线程："+thread.getName());

        }
    }
}
